package org.hcyspartnoc.demo.common.core.configuration;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
@ConfigurationProperties(prefix = "weixin")
public class WeiXinConfiguration {
    private String appId;
    private String appSecret;
    private OpenId openId;
    private Mch mch;

    @Data
    @Configuration
    @ConfigurationProperties(prefix = "weixin.open-id")
    public static class OpenId {
        private String baseUrl;
        private String grantType;
    }

    @Data
    @Configuration
    @ConfigurationProperties(prefix = "weixin.mch")
    public static class Mch {
        private String id;
        private String serialNo;
        private String notifyUrl;
        private String keyPath;
        private String apiKey;
    }
}
